package com.boang.state;

import java.util.concurrent.locks.LockSupport;

/*
    @author:sa
    @date:2024/11/27 9:53
*/
public class ThreadStateSupportDemo03 {
    public static void main(String[] args) {
        Object lock=new Object();
        Thread t0=new Thread(new Runnable() {
            @Override
            public void run() {
                LockSupport.park();
                    System.out.println("abc");
            }
        });t0.start();
        new Thread(new Runnable() {
            @Override
            public void run() {
                synchronized (lock) {
                    System.out.println("def");
                    LockSupport.unpark(t0);
                }
            }
        }).start();
    }
}